home *** CD-ROM | disk | FTP | other *** search
- Short: UDPfuncsV2.4 for Blitz-good for Net games
- Author: anton@ww.co.nz (Anton Reinauer)
- Uploader: anton@ww.co.nz (Anton Reinauer)
- Version: 2.4
- Type: dev/basic
- Requires: dev/basic/TCP-to-Blitz.lha, WB 2.0+, min 1.5 meg mem.
-
- These are functions to use the UDP protocol for multiplayer internet
- games in Blitz2. Also there is a small IRC-like chat program which is a
- good Net game communications test-bed. It checks wether packets have
- arrived at their destination by using an acknowledgement system, and
- resends packets if necessary. Also it can also act as either a Server
- or Client. It has full Connect/Disconnect routines- each player is informed
- of the new player and starts sending any messages to the new player, as
- the communication is still Peer-To-Peer. Players are automatically
- disconnected by the Server if they can't be contacted for a certain amount
- of time.
- There's a few TCP functions as well, like converting an ASCII address to
- numerical (long), and vice-versa, getting your local IP address etc. Some
- of the log-in and message protocols could be used in TCP games as well.
- It has an Arexx port to allow you to automatically connect to other
- UDP_Chat programs from AmiComSys, IRC, StrICQ etc- you just have to pass a
- host address to UDP_Chat.
-
- UDP is more appropriate for fast action games, like Doom clones,
- Xwing clones, or platformers, maze games etc; anything that needs small
- lags (ping times), to remain playable over the Internet/LAN.
-
- What's new in V2.4!
-
- Version 2.4 26/4/1999
- ------------
- Changed Exit{} - I took all the UDP stuff out of it and put it into
- Close_UDP{}, in UDP_Funcs- Exit{} now calls Close_UDP{} instead. I took
- all the non comms stuff out of Comms_Housekeeping{} and put it into
- General_Housekeeping{}. I've added in lots of constants like #ONLINE,
- #SERVER, #HIGH etc, to make things easier to read and understand.
- All the Functions, Variables/Constants and Dims have been separated
- into Game (specific to UDP_Chat and can be easily changed for your game), and
- UDP (specific only to the UDP Functions and independant of your game).
- Print_String{} is before the UDP Functions, but when I change
- Security_Warning{} and Comms_Debug{} to be GUI independant, it can be put
- with the Game Functions.
- All Print_String{} calls in the Funcs have been replaced with
- Security_Warning{} or Comms_Debug{} calls- they are called with different
- levels of degree, so you can just, for example print out System messages or
- all Security messages (from High priority to Low), by changing the variables
- `security' and `comms_debug_level'. So now it's much easier to put the
- UDP_Funcs into your game, as I've almost fully made the UDP_Funcs independant
- of the GUI.
- Added checking in Decode_Packet{}, to make sure that we should be
- able to receive the current packet in our current online state.
- Changed #DEBUG TO #COMMS_DEBUG. Comms_Housekeeping{} now returns wether
- we have been connected, disconnected or our connection attempt was rejected.
- #MAX_NUMBER_PLAYERS has been changed to a variable (max_number_players), to
- allow user to change the maximum number of allowed players (the function is
- is done, but I haven't written a GUI example yet).
- Security_Warning{} has been moved in with the other UDP Funcs, along with
- Comms_Debug{}- at the moment they print to the GUI, but soon I will have
- them putting their messages into arrays, to allow them to be independant of
- the GUI. Added #SERVER_NUMBER=1, as the #SERVER number is changed to allow
- for the added #ATTEMPTING_TO_CONNECT state. A few other changes are made
- for this as well.
- UDP_Funcs is now V1.4. UDP_Header is V1.1 .
- Fixed a couple of small bugs in Requested_Connection{}, and changed it's
- reply for a failed connection attempt to an unreliable message (WriteUDP{}).
- Fixed a couple of small bugs in Decode_Packet{}, and re-arranged it a bit
- to make in independant of the GUI. The call to Read_UDP{} is now done from
- Decode_Packet{}, instead of Comms_Housekeeping{}.
- Window_Events{} had a couple of disconnect bugs and it's been changed
- to allow for the #ATTEMPTING_TO_CONNECT status. General_Housekeeping{}
- prints out the lag times now.
- UDP_Chat no longer starts up being able to act as Server, you have to
- put it in Server mode (as you would in a game) first- there's a Function,
- Initialise_Server{} to do it, and a button in UDP_Chat to put you in
- Server mode. Also there's a Disconnect button to disconnect you from the
- game if you're a Client, and to close down the game and take you out of
- Server mode if you're the Server- this done with the Disconnect_From_Game{}
- Function.
- The Delay buttons are now changed to button 1: (Delay 1 second), and
- 2: (Delay 80 seconds), also button 8: pauses (freezes) and unpauses UDP_Chat.
- It prints `Me' in the lag time area at your player number, if you're a
- Client and Serv in the player 1 position if you're acting as Server.
- All the Game Functions have been separated out and put together after
- the UDP_Funcs. The UDP Newtypes have been put into UDP_Header and the Game
- variables, constants, and Dims have been separated from the UDP ones and put
- above the Game Functions. When I fix Security_Warning{} and Comms_Debug{}
- I can put Print_String{} in with the Game Functions, so all the UDP stuff
- will be together, so all you'd have to do to put them into your game is copy
- the entire UDP section and then paste it above your own Functions! All the
- UDP Functions could be put into the UDP_Funcs include if you didn't want
- them in your program.
-